﻿using System.Collections.Generic;
using System.Linq;
using AdventureWorks.Entities;
using Xomega.Framework;
using Xomega.Framework.Services;

namespace AdventureWorks.Services
{
    public class StateProvinceService : EntityServiceBase<AdvWorksEntities>, IStateProvinceService
    {
        public IEnumerable<State> ReadList()
        {
            var states = from st in objCtx.StateProvince
                         select new State()
                         {
                             StateProvinceId = st.StateProvinceId,
                             StateProvinceCode = st.StateProvinceCode,
                             Name = st.Name,
                             CountryRegionCode = st.CountryRegionCodeObject.CountryRegionCode
                         };
            return states.ToList();
        }
    }
}
